package com.mhxy.common;

import com.xnx3.robot.Robot;
import com.xnx3.robot.support.CoordBean;
import demo.ImageDemo;

import java.util.List;

//找图
public class Image extends  Robot{

    public CoordBean imageSearchByScreen(int xStart,int yStart,int xEnd,int yEnd,String searchImageName){
        Robot robot = new Robot();
        robot.setSourcePath(ImageDemo.class);
        List<CoordBean> list = robot.imageSearch(xStart, yStart, xEnd, yEnd, searchImageName, Robot.SIM_ACCURATE);

        for (int i = 0; i < list.size(); i++) {
            CoordBean coord = list.get(i);
            return coord;
        }
        return null;
    }

    //在当前窗口找驿站老板

}
